package Underworld_Survival;

import java.io.Serializable;

public class EquipmentSlot<T extends Equipment> implements Serializable {
    private T equippedItem;

    public EquipmentSlot(){}
    public void equip(T item){
        this.equippedItem=item;
    }
    public void unequip() {this.equippedItem = null;}
    public T getEquippedItem(){
        return equippedItem;
    }
    public String getEquippedItemId(){return equippedItem.getItemId();}
    public boolean isEmpty(){
        return equippedItem==null;
    }

}

class WeaponSlot extends EquipmentSlot<Weapon>{
    public boolean hasWeapon(){return getEquippedItem()!=null;}
}
class ArmorSlot extends EquipmentSlot<Armor>{
    public boolean hasArmor(){return getEquippedItem()!=null;}
}
class ShoeSlot extends EquipmentSlot<Shoe>{
    public boolean hasShoe(){return getEquippedItem()!=null;}
}